package com.yicong.ants.bean.coin;


import com.yicong.ants.bean.YcAccountInfo;

/**
 * @author cchao
 * @version 2019-05-24.
 */

public class TransInfo {
    String coin;
    // 最大可转赠门票
    String can_trans_coin;
    float tax_level;
    String stock;
    String direct_auth_child;
    String energy;
    int need_code_verify;
    int have_pay_password;
    int energy_task_open;
    float verify_coin;
    int transfer_confirm_num;
    float trans_tax;//手续费
    String stock_tax;

    public TransInfo() {
    }

    public int getTransTaxBF(){
        return (int)(trans_tax*100);
    }

    public static TransInfo instance(CoinInfo coinInfo) {
        TransInfo info = new TransInfo();
        info.setCoin(coinInfo.getCoin_total())
            .setStock(coinInfo.getStock())
            .setTax_level(coinInfo.getTax_level())
            .setCan_trans_coin(coinInfo.getCoin_can_trans())
            .setHave_pay_password(coinInfo.getHave_pay_password());
        return info;
    }

    public static TransInfo instance(YcAccountInfo coinInfo) {
        TransInfo info = new TransInfo();
        info.setCoin(coinInfo.getYc())
                .setStock(coinInfo.getYc_stock())
                .setTax_level(Float.valueOf(coinInfo.getYc_tax_ratio()))
                .setCan_trans_coin(coinInfo.getYc_can_trans())
                .setHave_pay_password(Integer.valueOf(coinInfo.getHave_pay_password()));
        return info;
    }

    public int getEnergy_task_open() {
        return 0;
    }

    public String getCoin() {
        return this.coin;
    }

    public String getCan_trans_coin() {
        return this.can_trans_coin;
    }

    public float getTax_level() {
        return this.tax_level;
    }

    public String getStock() {
        return this.stock;
    }

    public String getDirect_auth_child() {
        return this.direct_auth_child;
    }

    public String getEnergy() {
        return this.energy;
    }

    public int getNeed_code_verify() {
        return this.need_code_verify;
    }

    public int getHave_pay_password() {
        return this.have_pay_password;
    }

    public float getVerify_coin() {
        return this.verify_coin;
    }

    public int getTransfer_confirm_num() {
        return this.transfer_confirm_num;
    }

    public float getTrans_tax() {
        return this.trans_tax;
    }

    public String getStock_tax() {
        return this.stock_tax;
    }

    public TransInfo setCoin(String coin) {
        this.coin = coin;
        return this;
    }

    public TransInfo setCan_trans_coin(String can_trans_coin) {
        this.can_trans_coin = can_trans_coin;
        return this;
    }

    public TransInfo setTax_level(float tax_level) {
        this.tax_level = tax_level;
        return this;
    }

    public TransInfo setStock(String stock) {
        this.stock = stock;
        return this;
    }

    public TransInfo setDirect_auth_child(String direct_auth_child) {
        this.direct_auth_child = direct_auth_child;
        return this;
    }

    public TransInfo setEnergy(String energy) {
        this.energy = energy;
        return this;
    }

    public TransInfo setNeed_code_verify(int need_code_verify) {
        this.need_code_verify = need_code_verify;
        return this;
    }

    public TransInfo setHave_pay_password(int have_pay_password) {
        this.have_pay_password = have_pay_password;
        return this;
    }

    public TransInfo setEnergy_task_open(int energy_task_open) {
        this.energy_task_open = energy_task_open;
        return this;
    }

    public TransInfo setVerify_coin(float verify_coin) {
        this.verify_coin = verify_coin;
        return this;
    }

    public TransInfo setTransfer_confirm_num(int transfer_confirm_num) {
        this.transfer_confirm_num = transfer_confirm_num;
        return this;
    }

    public TransInfo setTrans_tax(float trans_tax) {
        this.trans_tax = trans_tax;
        return this;
    }

    public TransInfo setStock_tax(String stock_tax) {
        this.stock_tax = stock_tax;
        return this;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof TransInfo)) return false;
        final TransInfo other = (TransInfo) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$coin = this.getCoin();
        final Object other$coin = other.getCoin();
        if (this$coin == null ? other$coin != null : !this$coin.equals(other$coin)) return false;
        final Object this$can_trans_coin = this.getCan_trans_coin();
        final Object other$can_trans_coin = other.getCan_trans_coin();
        if (this$can_trans_coin == null ? other$can_trans_coin != null : !this$can_trans_coin.equals(other$can_trans_coin))
            return false;
        if (Float.compare(this.getTax_level(), other.getTax_level()) != 0) return false;
        final Object this$stock = this.getStock();
        final Object other$stock = other.getStock();
        if (this$stock == null ? other$stock != null : !this$stock.equals(other$stock))
            return false;
        final Object this$direct_auth_child = this.getDirect_auth_child();
        final Object other$direct_auth_child = other.getDirect_auth_child();
        if (this$direct_auth_child == null ? other$direct_auth_child != null : !this$direct_auth_child.equals(other$direct_auth_child))
            return false;
        final Object this$energy = this.getEnergy();
        final Object other$energy = other.getEnergy();
        if (this$energy == null ? other$energy != null : !this$energy.equals(other$energy))
            return false;
        if (this.getNeed_code_verify() != other.getNeed_code_verify()) return false;
        if (this.getHave_pay_password() != other.getHave_pay_password()) return false;
        if (this.getEnergy_task_open() != other.getEnergy_task_open()) return false;
        if (Float.compare(this.getVerify_coin(), other.getVerify_coin()) != 0) return false;
        if (this.getTransfer_confirm_num() != other.getTransfer_confirm_num()) return false;
        if (Float.compare(this.getTrans_tax(), other.getTrans_tax()) != 0) return false;
        final Object this$stock_tax = this.getStock_tax();
        final Object other$stock_tax = other.getStock_tax();
        if (this$stock_tax == null ? other$stock_tax != null : !this$stock_tax.equals(other$stock_tax))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof TransInfo;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $coin = this.getCoin();
        result = result * PRIME + ($coin == null ? 43 : $coin.hashCode());
        final Object $can_trans_coin = this.getCan_trans_coin();
        result = result * PRIME + ($can_trans_coin == null ? 43 : $can_trans_coin.hashCode());
        result = result * PRIME + Float.floatToIntBits(this.getTax_level());
        final Object $stock = this.getStock();
        result = result * PRIME + ($stock == null ? 43 : $stock.hashCode());
        final Object $direct_auth_child = this.getDirect_auth_child();
        result = result * PRIME + ($direct_auth_child == null ? 43 : $direct_auth_child.hashCode());
        final Object $energy = this.getEnergy();
        result = result * PRIME + ($energy == null ? 43 : $energy.hashCode());
        result = result * PRIME + this.getNeed_code_verify();
        result = result * PRIME + this.getHave_pay_password();
        result = result * PRIME + this.getEnergy_task_open();
        result = result * PRIME + Float.floatToIntBits(this.getVerify_coin());
        result = result * PRIME + this.getTransfer_confirm_num();
        result = result * PRIME + Float.floatToIntBits(this.getTrans_tax());
        final Object $stock_tax = this.getStock_tax();
        result = result * PRIME + ($stock_tax == null ? 43 : $stock_tax.hashCode());
        return result;
    }

    public String toString() {
        return "TransInfo(coin=" + this.getCoin() + ", can_trans_coin=" + this.getCan_trans_coin() + ", tax_level=" + this.getTax_level() + ", stock=" + this.getStock() + ", direct_auth_child=" + this.getDirect_auth_child() + ", energy=" + this.getEnergy() + ", need_code_verify=" + this.getNeed_code_verify() + ", have_pay_password=" + this.getHave_pay_password() + ", energy_task_open=" + this.getEnergy_task_open() + ", verify_coin=" + this.getVerify_coin() + ", transfer_confirm_num=" + this.getTransfer_confirm_num() + ", trans_tax=" + this.getTrans_tax() + ", stock_tax=" + this.getStock_tax() + ")";
    }
}
